package com.dzl.exchange.dao;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.exchange.pojo.WelfareExchangeSecret;
import com.dzl.exchange.pojo.dto.ExchangeSecretDto;
import com.dzl.exchange.pojo.query.ExchangeSecretQuery;
import com.dzl.exchange.pojo.vo.ExchangeSecretVo;
import com.dzl.exchange.pojo.vo.ExchangeUserSecretVo;
import com.dzl.exchange.pojo.vo.WelfareExchangeWithSecretVo;
import com.dzl.fee.pojo.WelfareFeeUserCustomers;
import com.dzl.fee.pojo.WelfareFeeUserSales;
import com.dzl.fee.pojo.query.WelfareSalesCustomersQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 兑换券信息表(WelfareExchangeSecretDetails)表数据库访问层
 * @author caobucao
 * @date 2021-07-09 18:29:18
 */
@Repository
public interface WelfareExchangeSecretMapper extends BaseMapper<WelfareExchangeSecret> {

    /**
     * 查询兑换券密列表
     * @date 2021/7/9 19:11
     * @author caobucao
     * @param query 查询条件
     * @return java.util.List<com.dzl.exchangesecretdetails.pojo.vo.ExchangeSecretVo>
     */
    List<ExchangeSecretVo> selectExchangeSecretPage(ExchangeSecretQuery query);

    /**
     * 通过选中ids查询兑换券LIST
     * @date 2021/7/10 9:43
     * @author caobucao
     * @param ids 选中ids
     * @return java.util.List<com.dzl.exchangesecretdetails.pojo.WelfareExchangeSecretDetails>
     */
    List<WelfareExchangeSecret> selectByIds(@Param("ids") String ids);

    /**
     * 批量激活、冻结、解冻兑换券
     * @date 2021/7/10 10:02
     * @author caobucao
     * @param dto  操作兑换券对象
     * @return java.lang.Integer
     */
    Integer updateBatchExchangeSecretByIds(ExchangeSecretDto dto);

    /**
     * 获取用户绑定的兑换券列表
     *
     * @author ChenLong
     * @date 2021-07-10 14:20:15
     * @param userId
     * @return java.util.List
     **/
    List<WelfareExchangeWithSecretVo> getUserExchangeBindList(@Param("userId") Integer userId);

    /**
     * 获取兑换券信息
     *
     * @author ChenLong
     * @date 2021-07-10 19:26:05
     * @param exchangeSecretId
     * @return java.util.List
     **/
    WelfareExchangeWithSecretVo getExchangeInfoByExchangeSecretId(@Param("exchangeSecretId") Integer exchangeSecretId);

    /**
     * 通过用户ID查询用户卡的详细信息
     * @date 2021/7/12 11:15
     * @author caobucao
     * @param userId 用户id
     * @return java.util.List<com.dzl.exchange.pojo.vo.ExchangeUserSecretVo>
     */
    List<ExchangeUserSecretVo> selectUserExchangeSecretVoListByUserId(@Param("userId") Integer userId);

    /**
     * 查询当前年份的兑换券密总数
     * @date 2021/7/30 16:29
     * @author caobucao
     * @param s K+年份后两位
     * @return java.lang.Integer
     */
    Integer selectCountYearExchange(@Param("s") String s);

    /**
     * 查询该券密组下面的业务员
     * @date 2021/9/18 10:48
     * @author caobucao
     * @param query 查询条件
     * @return java.util.List<com.dzl.fee.pojo.WelfareFeeUserSales>
     */
    List<WelfareFeeUserSales> selectSalesByExchangeId(WelfareSalesCustomersQuery query);

    /**
     * 查询该券密组下面的客户
     * @date 2021/9/18 10:52
     * @author caobucao
     * @param query 查询条件
     * @return java.util.List<com.dzl.fee.pojo.WelfareFeeUserCustomers>
     */
    List<WelfareFeeUserCustomers> selectCustomersByExchangeId(WelfareSalesCustomersQuery query);
}
